package com.systop.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.systop.domain.vo.GoodsSalesVo;
import com.systop.domain.vo.SumSalesVo;
import com.systop.entity.Consignee;
import com.systop.entity.Goods;
import com.systop.entity.Order;
import com.systop.entity.SysUser;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface OrderDao extends BaseMapper<Order> {
    //查询订单数据
    public List<Order> findAllOrders(Order order);
    //查询符合条件的订单总数
    public int countOrders(Order order);
    //查询所有用户名,返回到下拉框
    public List<SysUser> findAllUser();
    //查询所有收货人，前台根据相关用户名显示对应收货人
    public List<Consignee> findAllConsignee();
    //查询所有商品
    public List<Goods> findAllGoods();

    //根据商品id查询单价和规格
    public Goods findPriceById(Order order);
    //添加订单
    public int addOrder(Order order);

    //删除订单
    public int delOrder(Order order);

    List<Order> queryMyOrderList(@Param("userId") Long userId);

    List<SumSalesVo> querySalesGroupByMonth(@Param("year") String year, @Param("month") String month);

    List<GoodsSalesVo> querySalesDetail(@Param("year") String year,@Param("month") String month);
}
